home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-02.iso
/
Pakiet bezpieczenstwa
/
mini Pentoo LiveCD 2006.1
/
mpentoo-2006.1.iso
/
livecd.squashfs
/
usr
/
lib
/
python2.4
/
site-packages
/
impacket
/
uuid.pyc
(
.txt
)
< prev
Wrap
Python Compiled Bytecode
|
2006-06-30
|
2KB
|
46 lines
# Source Generated with Decompyle++
# File: in.pyc (Python 2.4)
import re
from random import randrange
from struct import pack, unpack
def generate():
top = (0x1L << 31) - 1
return pack('IIII', randrange(top), randrange(top), randrange(top), randrange(top))
def bin_to_string(uuid):
(uuid1, uuid2, uuid3) = unpack('<LHH', uuid[:8])
(uuid4, uuid5, uuid6) = unpack('>HHL', uuid[8:16])
return '%08X-%04X-%04X-%04X-%04X%08X' % (uuid1, uuid2, uuid3, uuid4, uuid5, uuid6)
def string_to_bin(uuid):
matches = re.match('([\\dA-Fa-f]{8})-([\\dA-Fa-f]{4})-([\\dA-Fa-f]{4})-([\\dA-Fa-f]{4})-([\\dA-Fa-f]{4})([\\dA-Fa-f]{8})', uuid)
(uuid1, uuid2, uuid3, uuid4, uuid5, uuid6) = map((lambda x: long(x, 16)), matches.groups())
uuid = pack('<LHH', uuid1, uuid2, uuid3)
uuid += pack('>HHL', uuid4, uuid5, uuid6)
return uuid
def stringver_to_bin(s):
(maj, min) = s.split('.')
return pack('<H', int(maj)) + pack('<H', int(min))
def uuidtup_to_bin(tup):
if len(tup) != 2:
return None
return string_to_bin(tup[0]) + stringver_to_bin(tup[1])
def string_to_uuidtup(s):
g = re.search('([A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}).*?([0-9]{1,5}\\.[0-9]{1,5})', s + ' 1.0')
if g:
(u, v) = g.groups()
return (u, v)